<?php
include "include/config.inc.php";
$partyLoan = $_REQUEST['partyLoan'];

$selectPartyLoan = "SELECT loan.loanId, loan.loanDate, loan.loanAmount, loan.installmentReceived, loan.guaranterId, party.partyName, party.partyId
                    FROM loan
                    JOIN party ON party.partyId = loan.partyId
                   WHERE loan.partyId = '".$partyLoan."'";
$partyLoanRes = mysql_query($selectPartyLoan);
?>

<h1 align="center"> Party </h1>
<table id="datatables" align="center" border="1" class="display">
  <thead>
    <tr>
      <th>Guranter Id</th>
      <th>Party Name</th>
      <th>Loan Date</th>
      <th>Loan Amount</th>
      <th>Installment Received</th>
    </tr>
  </thead>
  <tbody id="insData">
  <?php
    while($partyLoanRow = mysql_fetch_array($partyLoanRes))
    { 
  ?>
      <tr>
        <td align="center"><?php echo $partyLoanRow['guaranterId']; ?> </td>
        <td align="center"><?php echo $partyLoanRow['partyName']; ?> </td>
        <td align="center"><?php echo $partyLoanRow['loanDate']; ?> </td>
        <td align="center"><?php echo $partyLoanRow['loanAmount']; ?> </td>
        <td align="center"><?php echo $partyLoanRow['installmentReceived']; ?> </td>
      </tr>
    <?php
    }
    ?>
  </tbody>
</table>